﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LCRReader
{
    public static class global
    {

        public static GenneralConfigAccess config = GenneralConfigAccess.Inst;
        public static float Voltage { get; set; }
        public static float Current { get; set; }
        public static float R { get; set; }

        public static bool  UResult { get; set; }
        public static bool IResult { get; set; }
        public static bool RResult { get; set; }

        public static bool ResultAll { get { return (UResult && IResult && RResult); } }
        static string strDaytime
        {
            get
            {
                var str = config.GetValue("DAY");
                if (str == "NA")
                {
                    str = "8:00,20:00";
                }
                return str;
            }
        }
        public static DateTime DayBegin { get { return DateTime.Parse(strDaytime.Split(',')[0]); } }

        public static DateTime DayEnd { get { return DateTime.Parse(strDaytime.Split(',')[1]); } }

        public static string Banbie
        {
            get
            {
                if (DateTime.Now > DayBegin && DateTime.Now < DayEnd)
                {
                    return "白班";
                }
                else
                {
                    return "晚班";
                }
            }
        }
        public static string Line
        {
            get {

                return GenneralConfigAccess.Inst.GetValue("LINE");
            }
        
        }


    }
}
